package com.ycxy.school.express.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ycxy.school.express.pojo.vo.CompanyListItemVO;
import com.ycxy.school.express.pojo.vo.RoleListItemVO;
import com.ycxy.school.express.service.ICompanyService;
import com.ycxy.school.express.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author jayLuo
 * @Date 2023/1/11 17:14
 * @PackageName:com.ycxy.school.express.controller
 * @ClassName: CompanyController
 * @Description: TODO
 * @Version 1.0
 */
@Slf4j
@Api(tags = "07. 快递公司管理模块")
@RestController
@RequestMapping("/companies")
public class CompanyController {

    @Autowired
    private ICompanyService companyService;

    // http://localhost:9080/companies
    @ApiOperation("查询公司列表")
    @ApiOperationSupport(order = 420)
    @GetMapping("")
    public JsonResult<List<CompanyListItemVO>> list() {
        log.debug("开始处理【查询公司列表】的请求，无参数");
        List<CompanyListItemVO> list = companyService.list();
        return JsonResult.ok(list);
    }
}
